package com.umsoft.chapter4.test;

public class GreetingProxy implements Greeting {

    private GreetingImpl greeting;
    public GreetingProxy(){
        greeting = new GreetingImpl();
    }



    @Override
    public void sayHello(String message) {
        doBefore();
        greeting.sayHello(message);
        doAfter();
    }

    private void doAfter() {
        System.out.println("After……");
    }

    private void doBefore() {
        System.out.println("Before……");

    }
}
